<!-- 订单备注页面 -->
<template name='order_descr'>
	<view class="width100 " @click.stop>
		<view class="riskTitle">{{account}}：</view>
		<input
		@click.stop
		v-model="descr" 
		@confirm = "settingDescr"
		class = "search-ipu font12"
		:placeholder = "tipmsg"
		placeholder-class = "placeholder-class"
		/>
	</view>
</template>
<script>
	
	export default{
		name:'order_descr',
		components: {
		},
		data(){
			return{
				descr:''
			}
		},
		 // 此处定义传入的数据
		props: {
			/**
			 * 字段名
			*/
			account: {
				type:String,
				default :'备注'
			},
			
			/**
			 * 提示词
			*/
			tipmsg: {
				type:String,
				default :'输入附加备注'
			},
				
			/**
			 * 备注
			*/
			value: {
				type:String,
				default :''
			},
			
			/**
			 * 订单号
			*/
			order_id: {
				type:String,
				default :''
			},
		},
		watch: {
			value(newVal, oldVal) {
				// 这里可以执行你需要的任何操作
				if(this.value == undefined ){
					return
				}
				this.descr = this.value
			}
		},
		created() {
			this.descr = this.value
		},
		methods:{
			/**
			 * 修改备注
			*/
			settingDescr(){
				var that = this
				//console.log('that.searchWord',that.searchWord)
				if( that.order_id==""){
					return
				}
		
				that.$common.get_request(
					{
						type: 'order_descr',
						value: that.descr,
						order_id: that.order_id,
					},
					(res)=>{
						that.$common.toast(res.msg)
					}
				);
			},
		}
	}
</script>

<style>
	.width100{
		min-width: 100px;
		width: 100%;
		display: flex;
	}
	.search-ipu{
		min-width: 100px;
		border: solid 1px #ddd;
	}
</style>
